package com.hinnotek.amoeba.ui.activity.old

import android.os.Bundle
import android.view.View
import com.lee.common.base.BaseActivity
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.databinding.ActivityStaffSalaryBinding
import com.hinnotek.amoeba.utilities.ClickUtil
import com.hinnotek.amoeba.utilities.ToastUtils
import com.hinnotek.amoeba.ext.initAdapter
import com.xuexiang.xui.utils.ResUtils
import com.xuexiang.xutil.common.StringUtils

class StaffSalaryActivity : BaseActivity<ActivityStaffSalaryBinding>() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setLeftVisible(true)
        setTitle("人员工资")

        setContentView(R.layout.activity_staff_salary)
    }

    override fun initVew() {

        bindingView.spinnerEmployeeChoose.setOnClickListener { v: View? ->
            ToastUtils.show(
                mContext,
                "adfasdfasdfas"
            )
        }
        findViewById<View>(R.id.superButton_add).setOnClickListener { v: View? ->
            if (ClickUtil.isFastClick()) {
                return@setOnClickListener
            }
            val employeeChooseS: String =
                bindingView.spinnerEmployeeChoose.editText.text.toString().trim()
            if (StringUtils.isEmpty(employeeChooseS)) {
                ToastUtils.show(mContext, "请选择员工名称")
                return@setOnClickListener
            }
            val etEmployeeSalaryS: String =
                bindingView.etEmployeeSalary.text.toString().trim()
            if (StringUtils.isEmpty(etEmployeeSalaryS)) {
                ToastUtils.show(mContext, "请输入员工工资金额")
                return@setOnClickListener
            }
            val etFiveInsuranceS: String =
                bindingView.etFiveInsurance.text.toString().trim()
            if (StringUtils.isEmpty(etFiveInsuranceS)) {
                ToastUtils.show(mContext, "请输入员工五险金额")
                return@setOnClickListener
            }
            finishActivity()
        }
    }

    override fun setData() {
        bindingView.spinnerEmployeeChoose.initAdapter(ResUtils.getStringArray(R.array.sort_mode_entry))
    }
}